<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<f:view contentType="text/html">
	<h:head>
		<style type="text/css">@import url(../css/estilo.css);</style>
	</h:head>
	<h:body>
		<p:layout fullPage="true">

			<p:layoutUnit position="top" height="175" id="top_layout" resizable="false"
				closable="false" collapsible="false">
				<div align="center"><img src="../imagens/chamado_user.png"
					width="1000"></img></div>
			</p:layoutUnit>

			<p:layoutUnit position="bottom" height="30"
				header="Desenvolvido por André Ricardo Gnhoato • João Carlos V. Siqueira • Lubian Carmona • ©2011"
				resizable="false" closable="false" collapsible="true">
			</p:layoutUnit>

			<p:layoutUnit position="left" width="200" header="Menu"
				resizable="true" closable="false" collapsible="true">
				<h:form>
					<p:menu style="width:180px">
						<p:submenu label="Chamadas" icon="ui-icon ui-icon-refresh">
							<p:menuitem value="Nova" action="#{chamadaController.novaChamada}" ajax="false"
								icon="ui-icon ui-icon-contact" />
						</p:submenu>
						<p:submenu label="Usuário" ajax="false" >
							<p:menuitem value="Bem-vindo: #{UsuarioController.usuario.login}"/>
							<p:menuitem value="Sair" action="#{UsuarioController.logout}" ></p:menuitem>
						</p:submenu>
					</p:menu>
				</h:form>


			</p:layoutUnit>

			<!--    <p:layoutUnit position="right" width="200" header="Right" resizable="true" closable="true" collapsible="true">  -->
			<!--        <h:outputText value="East unit content." />  -->
			<!--    </p:layoutUnit>  -->

			<p:layoutUnit position="center" scrollable="true">
				<h:form>
					<p:dataTable var="chamada" id="c"
						value="#{chamadaController.chamadasUsuario}" paginator="false" 
						rows="10" selection="#{chamadaController.chamada}"
						selectionMode="single" rowSelectListener="#{chamadaController.onRowSelectNavigate}">

						<f:facet name="header">  
            				Lista de Chamadas 
        				</f:facet>

						<p:column sortBy="#{chamada.descricao}">
							<f:facet name="header">
								<h:outputText value="Descrição" />
							</f:facet>
							<h:outputText value="#{chamada.descricao}" />
						</p:column>

						<p:column sortBy="#{chamada.data}">
							<f:facet name="header">
								<h:outputText value="Data" />
							</f:facet>
							<h:outputText value="#{chamada.data}" />
						</p:column>

						<p:column sortBy="#{chamada.categoria}">
							<f:facet name="header">
								<h:outputText value="Categoria" />
							</f:facet>
							<h:outputText value="#{chamada.categoria}" />
						</p:column>

						<p:column sortBy="#{chamada.prioridade}">
							<f:facet name="header">
								<h:outputText value="Prioridade" />
							</f:facet>
							<h:outputText value="#{chamada.prioridade}" />
						</p:column>

					</p:dataTable>

				</h:form>
			</p:layoutUnit>

		</p:layout>
		<div id="logo"></div>
	</h:body>
</f:view>
</html>
